<?php 
/**************************************************/
## Class Name - Model_City (Contains all the functions related City modules)
## Created By - Techmodi (22/08/2011)
/**************************************************/
class Model_Webcode extends Database
{	
	function Model_Webcode() {	
		$this->webcode = WEBCODE;	
		$this->Database();
	}
	
	function addWebcode($array) {
		$this->InsertData($this->webcode, $array);
	}
	
	## List all submenus
	function getAllWebcode($search='',$col1,$limit='',$offset='') {
		$fields = array();	
		$tables = array($this->webcode);
		if($col1=='1')
			$order = array("verified_name DESC");
		else
			$order = array("verified_name ASC");
		$result1 = $this->SelectData($fields,$tables, $where= array("verified_name LIKE '%".$search."%'"), $order , $group=array(),$limit,$offset,0); 
		$result  = $this->FetchAll($result1); 
		return $result;
	}
	
	## Get submenu details by id
	function getWebcodeDetailsById($webcode_id) {
		$fields = array();	
		$tables = array($this->webcode);
		$result1 = $this->SelectData($fields,$tables, $where= array("webcode_id='".$webcode_id."'"), $order = array(), $group=array(),$limit = "",0,0); 
		$result  = $this->FetchRow($result1); 
		return $result;
	}
	
	## Delete webcode with multiple ids
	function deleteWebcode($ids) {
		$sql = "DELETE FROM ".$this->webcode." WHERE webcode_id IN (".$ids.")";
		$result1= $this->ExecuteQuery($sql);	 
	}
	
	
	## Delete faq cat by id
	function deleteWebcodeById($id){
		$this->DeleteData($this->webcode,"webcode_id",$id);
	}
	
	## Edit FAQ by id
	function editWebcodeById($array, $Id){
		$this->UpdateData($this->webcode,$array,"webcode_id",$Id,0);
	}
	

    ## Update faq status with multiple ids
	function updateWebcodeStatus($ids, $status) {
		$sql = "UPDATE ".$this->webcode." SET status='".$status."' WHERE webcode_id IN (".$ids.")";
		$result1= $this->ExecuteQuery($sql);	 
	}
	

	
}
?>


